package com.example.springLearning.part8.service;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.Date;


@Service
@Slf4j
public class Electric8Service {

    Logger logger = LoggerFactory.getLogger(Electric8Service.class);

    @Lazy
    @Autowired
    Electric8Service electric8Service;

    public void charge() {
        electric8Service.doCharge();
    }

    public void doCharge() {
        System.out.println("Electric charging...");
    }

    public void doLog() {
        logger.info("logger , time: " + new Date());
    }
}
